package com.shhm.business.controller.business;

import com.shhm.business.dto.request.FilterProductReq;
import com.shhm.business.service.business.BusinessHomeService;
import com.shhm.business.service.business.BusinessSearchService;
import com.shhm.common.dto.response.AjaxResultPlus;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * @author JackZ
 * @version 1.0
 * @description: 搜索页相关接口
 * @date 2025/9/11 下午3:40
 */
@RestController
@RequestMapping("/business")
public class BusinessSearchController {
    @Resource
    private BusinessSearchService businessSearchService;
    @Resource
    private BusinessHomeService businessHomeService;

    @GetMapping("/overview")
    public AjaxResultPlus getHomeOverview(){
        return businessSearchService.getHomeOverview();
    }

    @PostMapping("/product/filter")
    public AjaxResultPlus productTypeList(
            @RequestParam(defaultValue = "1") Integer pageNum,
            @RequestParam(defaultValue = "12") Integer pageSize,
            @RequestBody FilterProductReq entity
    ) {
//        System.out.println(entity.toString());
        return businessHomeService.productTypeList(pageNum, pageSize, entity);
    }
}
